{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 衡量回归算法的标准"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn import datasets"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 波士顿房产数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "boston = datasets.load_boston()         #加载波士顿房产数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "#print(boston.DESCR)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', 'RM', 'AGE', 'DIS', 'RAD',\n",
       "       'TAX', 'PTRATIO', 'B', 'LSTAT'], dtype='<U7')"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "boston.feature_names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = boston.data[:, 5]          # 只用数据集的第5列，RM，房间数量average number of rooms per dwelling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(506,)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = boston.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(506,)"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xac5eda51c8>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD4CAYAAAAaT9YAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2df5AcZ5nfv8+O2tasCR7JLMQeW8hcKAl0Qlq8hZVTFXUSF+vA2Gz8E8dQVIqK8weVYHDtIVIEy1dOLKIQ+/5IkXJB7nxlzsiWYbFxgrjCulzFVTYneS18iq3KgW2ZkYIF1hqQxvLs7pM/Zno0M9tv99s9/Xu+nyrVaudH99M9O99++3m+7/OKqoIQQkgxGcs6AEIIIdGhiBNCSIGhiBNCSIGhiBNCSIGhiBNCSIFZkebO3vGOd+jatWvT3CUhhBSeQ4cO/UpVJ7yeS1XE165di4MHD6a5S0IIKTwi8orpOaZTCCGkwFDECSGkwFDECSGkwFDECSGkwFDECSGkwFi5U0TkZQC/BbAIYEFVp0RkNYC9ANYCeBnATap6KpkwybDMzjWwZ/9RHJ9v4pJaFTM71mF6sp51WEMR9zGleY7i3Ffan21c+3O305hvoiKCRdXuz3FnDM2FJagCFRHccuVluHt649D7H3zvtvUTOPDiyVg/h97jqafweYhNF8OOiE+p6q96HvtPAF5X1d0ishPAKlX9kt92pqamlBbD9Jmda+DL330ezdZi97GqU8E9120srJDHfUxpnqM495X2ZxvX/ry2E8SntqzB1LtXR96/zT7j/ByG3WYvInJIVae8nhsmnfIJAA90/v8AgOkhtkUSZM/+o8v+uJqtRezZfzSjiIYn7mNK8xzFua+0P9u49ue1nSAe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+Aq9C+hSsVqvr/ALwqIus6D30EwP/JMKSkuQUlTaV0OAZgi4iMi4ig/Xm+kHFMiSAi7+z8XAPgOgR8rnSnjB7vAvC99vcAKwD8lar+MNuQEuPfAPh2J9XwcwD/MuN4EqGTO/1nAP511rEkhao+IyL7ADyLdnphDuWdfv+oiFwEoAXgc6p6yu/FnHZPCCEFhukUQggpMBRxQggpMBRxQggpMBRxQggpMBRxQggpMBRxQggpMBRxQggpMP8fVR4GbRtSaO8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "50.0"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.max(y)             #最上面的点是因为超过了最大值50，因此要将它们舍弃"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = x[y <50]          # 删除异常点\n",
    "y = y[y <50]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xac61ab0648>"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD4CAYAAAAaT9YAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2df4wcZ5nnv8/0tO0eB9IOGC7uxNiwyGGzXnvICHxrCV3MEt8SEubyy3DZVXRC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X1UbIvI4gM8A+MtUBxYzIvIHAP4jgI8AuADgByJyQFV/ZnoNM/E2InIFgOsBfDPtsZD+EZF3AvgYgG8BgKpeUNW5dEeVOB8H8HNVzfqq6KiMAqiIyChaF+RTKY8nCT4E4AVVnVfVBQB/A+Df+b2AQfwiDwH4cwBLaQ9kACiAH4rIERG5M+3BJMT7AZwG8L/bEtk3RWR12oNKmM8AeCztQSSBqtYB/FcAJwG8AeCsqv4w3VElwk8BfExE3iUiYwA+CeBKvxcwiAMQkU8BeFNVj6Q9lgGxXVU/DOBPAHxeRD6W9oASYBTAhwF8Q1XHAZwDsDvdISVHWy66EcATaY8lCURkDYBPA9gIYB2A1SLyp+mOKn5U9RUAXwPwIwA/AHAMwILfaxjEW2wHcKOIvAbgOwB2iMi30x1ScqjqqfbPN9HSTz+S7ogS4dcAfq2qL7Z/fxKtoF5U/gTAS6r6m7QHkhB/DOCXqnpaVZsAngbwRymPKRFU9Vuq+mFV/RiAtwAY9XCAQRwAoKr3qOoVqroBrVvSQ6pauKs8AIjIahF5h/N/ANehdQtXKFT1/wF4XUQ2tR/6OID/m+KQkuazKKiU0uYkgG0iMiYigtb7+UrKY0oEEXlP++d6ADch4H2lO2X4eC+A77a+BxgF8Neq+oN0h5QY/xnAo22p4RcA/kPK40mEtnb6CQD/Ke2xJIWqvigiTwJ4CS15YRbFXX7/lIi8C0ATwOdV9Yzfk7nsnhBCcgzlFEIIyTEM4oQQkmMYxAkhJMcwiBNCSI5hECeEkBzDIE4IITmGQZwQQnLM/wfuhgLfMCncrAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x, y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用简单线性回归算法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append(\"G:/postgraduate_learning/machine learning algorithm/code/04/4-3 训练数据集，测试数据集\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "from playML.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train, x_test, y_train, y_test = train_test_split(x, y, seed=666)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(392,)"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(98,)"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_test.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "from playML.SimpleLinerRegression import SimpleLinerRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "SLR2()"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg = SimpleLinerRegression()\n",
    "reg.fit(x_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7.8608543562689555"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg.a_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-27.459342806705543"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg.b_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0xac66047048>]"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD4CAYAAAAaT9YAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2deZhU5ZWH39NNCd2oNBjcWrGNUUwQoWNrVBISMMoYUTsgGrfoyGASHXcRTJwIoxEIYzQZ4xaNmsEFBGkRjRtuiSOOYINKhKgRkIYoUZuAttDLN3/curXeW3VruVV1q877PDzN/eou51Z1/+5X55zvHDHGoCiKogSTqmIboCiKomSPiriiKEqAURFXFEUJMCriiqIoAUZFXFEUJcD0KuTFvvSlL5mGhoZCXlJRFCXwLF++/B/GmIFOrxVUxBsaGli2bFkhL6koihJ4RGSd22ueRFxE1gJbgW6gyxjTJCIDgLlAA7AWONUY82muxiqKoijeycQnPsoYM9wY0xTengosMcYcCCwJbyuKoigFJJfA5snAfeH/3wc0526OoiiKkgleRdwAT4vIchE5Pzy2hzFmE0D45+5OB4rI+SKyTESWbd68OXeLFUVRlAheA5sjjDEbRWR34BkRWe31AsaYO4E7AZqamrRQi6IoSh7xJOLGmI3hnx+JyELgCOBDEdnLGLNJRPYCPvLRTkVRFN9oaW1j9lNr2Njewd51NUweM5jmxvpim+WJtO4UEekrIrvY/weOA94CFgHnhHc7B3jULyMVRVH8oqW1jasfeZO29g4M0NbewdWPvElLa1uxTfOEl5n4HsBCEbH3f8AY86SIvAbME5GJwHpggn9mKopSzvg5E0537tlPraGjszvumI7ObmY/tSYQs/G0Im6M+RswzGH8Y+AYP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FpG3ReSoYtuUb0RkcPhztP/9U0QuLbZdfiAil4nIKhF5S0QeFJE+xbbJD0TkkvA9rvLyWQav272/XAK8DexabEMKwChjTLkvmPg18KQx5pRwpc3aYhuUb4wxa4DhEGmZ2AYsLKpRPiAi9cDFwNeMMR0iMg+rcuq9RTUsz4jIIcAkrM5pO4AnReRxY8w7bsfoTDyMiOwDnADcVWxblNwRkV2BkcDdAMaYHcaY9uJa5TvHAO8ZY0p9VXS29AJqRKQX1gO5HPsXfBVYaoz53BjTBbwIfD/VASriUW4GrgJ6im1IATDA0yKyXETOL7YxPvFlYDNwT9hFdpeI9C22UT7zA+DBYhvhB8aYNuC/gPXAJmCLMebp4lrlC28BI0VkNxGpBb5HfPOdJFTEAREZC3xkjFlebFsKxAhjzNeB44ELRWRksQ3ygV7A14HbjDGNwGfA1OKa5B9hd9FJwMPFtsUPRKQ/ViP2/YG9gb4iclZxrco/xpi3gVnAM8CTwEqgK9UxKuIWI4CTRGQt8BAwWkTmFNck/zDGbAz//AjLf3pEcS3yhQ3ABmPMq+Ht+ViiXq4cD7xujPmw2Ib4xHeB940xm40xncAjwNFFtskXjDF3G2O+bowZCXwCuPrDQUUcAGPM1caYfYwxDVhfSZ8zxpTdUx5ARPqKyC72/4HjsL7ClRXGmL8DH4jI4PDQMcBfimiS35xOmbpSwqwHjhSRWhERrM/z7SLb5Asisnv45yBgHGk+V81OqTz2ABZafwf0Ah4wxjxZXJN84yLg/rCr4W/AvxbZHl8I+06PBX5UbFv8whjzqojMB17Hci+0Ur7L7xeIyG5AJ3ChMebTVDvrsntFUZQAo+4URVGUAKMiriiKEmBUxBVFUQKMiriiKEqAURFXFEUJMCriiqIoAUZFXFEUJcD8P5WIJ7U4rRcyAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x_train, y_train)\n",
    "plt.plot(x_train, reg.predict(x_train), color='r')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_predict = reg.predict(x_test)   #预测 测试数据集x_test"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## MSE 均值方差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "24.156602134387438"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mse_test = np.sum((y_predict - y_test)**2 )/len(y_test)\n",
    "mse_test"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## RMSE 均方根误差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.914936635846635"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from math import sqrt\n",
    "rmse_test = sqrt(mse_test)\n",
    "rmse_test                          # 平均误差为rmse_test 美元"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## MAE 平均绝对误差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.5430974409463873"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mae_test = np.sum(np.absolute(y_predict - y_test))/len(y_test)\n",
    "mae_test                           #平均误差为mae_test  美元"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## scikit-learn中的MSE和MAE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import mean_squared_error\n",
    "from sklearn.metrics import mean_absolute_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "24.156602134387438"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_squared_error(y_test, y_predict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.5430974409463873"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_absolute_error(y_test, y_predict)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## R Squared"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6129316803937322"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1 - mean_squared_error(y_test, y_predict)/np.var(y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6129316803937324"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.metrics import r2_score\n",
    "r2_score(y_test, y_predict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
